package com.maimao.info.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.maimao.model.info.Coupon;
import com.maimao.model.info.CouponUser;
import com.maimao.model.info.vo.CouponSearch;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2021/1/5 4:34 下午
 */
public interface CouponUserMapper extends BaseMapper<CouponUser> {


    List<CouponUser> selectByUserIdAndCouponIds(@Param("userId") Long userId, @Param("couponIds") List<Long> couponIds);
    List<CouponUser> selectAllByUserIdAndCouponIds(@Param("userId") Long userId, @Param("couponIds") List<Long> couponIds);


    int updateUsed(@Param("userId") Long userId, @Param("orderId")Long orderId, @Param("usedTime") LocalDateTime usedTime, @Param("couponIds") List<Long> couponIds, @Param("used") Boolean used);
}
